package meterMonitor.mapper;

import meterMonitor.model.MonitorDay;
import meterMonitor.model.MonitorDetail;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;

public interface MonitorDayMapper {

    List<MonitorDay> countByDay(String start, String end);

    MonitorDay countByOneDay(String day);

    MonitorDay countByOneDayByDevice(@Param(value = "day1") String day1,@Param(value = "deviceTypeCode") int deviceTypeCode);

    List<MonitorDay> countByOneDayByDevice1(@Param(value = "day1") String day1,@Param(value = "deviceTypeCode") int deviceTypeCode);


    MonitorDay countElectricityByOneDay(String day);

    //查询当日用水量
    List<MonitorDay> queryByDay(String day);
    //查询当日用电量
    List<MonitorDay> queryElectricityByDay(String day);

    //根据时间和类型查询当天仪器的标准量
    List<MonitorDay> querySpec(@Param(value = "day") String day,@Param(value = "deviceTypeCode") int deviceTypeCode);
    //根据时间和meterCode查询当天仪器的标准量
    MonitorDay querySpecByMeterCode(@Param(value = "day") String day,@Param(value = "meterCode") Long meterCode);

    //yy根据设备类型查询设备当日用量
    List<MonitorDay> queryByDayByDevice(@Param(value = "day") String day,@Param(value = "deviceTypeCode") int deviceTypeCode);

    List<MonitorDay> queryByTimeQuantum(Timestamp start, Timestamp end);

    List<String> queryTimeQuantum(String start, String end);

    MonitorDay queryOne(MonitorDay monitorDay);

    MonitorDay queryOneWater(MonitorDay monitorDay);

    List<MonitorDay> queryOneWater1(MonitorDay monitorDay);

    MonitorDay queryOneElectricity(MonitorDay monitorDay);

    List<MonitorDay> queryOneElectricity1(MonitorDay monitorDay);


    //查询日数据
    List<MonitorDay> queryData(@Param("fromTime") String fromTime, @Param("toTime") String toTime, @Param("codes") String codes);

    List<MonitorDay> queryDataByType(@Param("fromTime") String fromTime, @Param("toTime") String toTime, @Param("areaId") Integer areaId,@Param("deviceTypeCode") int deviceTypeCode, @Param("codes") String codes);

    //当areaId为空的不作为条件
    List<MonitorDay> queryDataByTypeWithNoAreaId(@Param("fromTime") String fromTime, @Param("toTime") String toTime, @Param("areaId") String areaId,@Param("deviceTypeCode") int deviceTypeCode, @Param("codes") String codes);

    List<MonitorDay> queryDataByTypeWithNoAreaId1( @Param("areaId") String areaId,@Param("deviceTypeCode") int deviceTypeCode, @Param("codes") String codes);


    MonitorDetail queryCurrentQuantity(@Param("meterCode") Long meterCode, @Param("date") String date);

    List<MonitorDay> query(MonitorDay monitorDay);

    MonitorDay getCurrentByMeterCode(Long meterCode);
}
